package com.hainatong.shiphelper.login.view;

import android.os.Bundle;
import android.view.View;
import com.hainatong.shiphelper.Constants;
import com.hainatong.shiphelper.MvvmLazyFragment;
import com.hainatong.shiphelper.R;
import com.hainatong.shiphelper.databinding.FragmentPwdResultBinding;
import com.hainatong.mvvmbase.base.NoViewModel;

public class ResultFragment extends MvvmLazyFragment<FragmentPwdResultBinding,NoViewModel>
{
    private int pwdType = 0;

    @Override
    public int getLayoutId()
    {
        return R.layout.fragment_pwd_result;
    }

    @Override
    public int getBindingVariable() {
        return 0;
    }

    @Override
    protected void onRetryBtnClick()
    {
    }


    @Override
    protected void initParameters()
    {
       Bundle args = getArguments();
       if( args != null && args.size() > 0)
       {
          pwdType = args.getInt(Constants.PWD_SUCCESS_TYPE , 0);
       }
    }

    @Override
    protected void initView(View view)
    {

        String pwdSuccess = "";
        switch ( pwdType )
        {
            case 1:
                pwdSuccess = String.format( getString( R.string.set_pwd_success),getString( R.string.account_pwd ) );
                break;
            case 2:
                pwdSuccess = String.format( getString( R.string.set_pwd_success),getString( R.string.handle_pwd ) );
                break;
        }

        viewDataBinding.tvResult.setText( pwdSuccess );
    }
}
